Skip to content

Instantly share code, notes, and snippets.

Created March 14, 2017 01:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/8f1cc160356a75804924c7805fb9f95b to your computer and use it in GitHub Desktop.
Save anonymous/8f1cc160356a75804924c7805fb9f95b to your computer and use it in GitHub Desktop.
dual linear actuators w/ wedge
int kinematicsForward(const double *joints,
EmcPose * pos,
const KINEMATICS_FORWARD_FLAGS * fflags,
KINEMATICS_INVERSE_FLAGS * iflags)
{
// 2x2 Matrix components
double a = tan(26 * M_PI/180);
double b = -1.0 * tan(26 * M_PI/180);
double c = 1.0;
double d = 1.0;
pos->tran.x = b * joints[0] + a * joints[2];
pos->tran.z = joints[0]*2;
return 0;
}
int kinematicsInverse(const EmcPose * pos,
double *joints,
const KINEMATICS_INVERSE_FLAGS * iflags,
KINEMATICS_FORWARD_FLAGS * fflags)
{
// 2x2 Matrix components
joints[2] = pos->tran.z/2 + pos->tran.x;
joints[0] = pos->tran.z/2;
return 0;
}
int kinematicsHome(EmcPose * world,
double *joint,
KINEMATICS_FORWARD_FLAGS * fflags,
KINEMATICS_INVERSE_FLAGS * iflags)
{
*fflags = 0;
*iflags = 0;
return kinematicsForward(joint, world, fflags, iflags);
}
KINEMATICS_TYPE kinematicsType()
{
return KINEMATICS_BOTH;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment